package model

import "gorm.io/gorm"

type Video struct {
	gorm.Model
	Title    string `gorm:"type:varchar(50);not null;index;comment:视频标题"`
	Desc     string `gorm:"type:varchar(255);not null;index;comment:视频描述"`
	CoverUrl string `gorm:"type:varchar(255);not null;index;comment:视频封面"`
	UserId   uint   `gorm:"type:int;not null;index;comment:用户Id"`
	Status   int    `gorm:"type:tinyint;not null;index;default:0;comment:状态：0-连载，1-完结"`
	//VideoCategoryId       uint   `gorm:"type:int;not null;index;comment:视频分类Id"`
	ChannelId             uint `gorm:"type:int;not null;index;comment:视频频道Id"`
	AreaId                uint `gorm:"type:int;not null;index;comment:视频地区Id"`
	TypeId                uint `gorm:"type:tinyint;not null;index;default:0;"`
	YearId                uint `gorm:"type:int;not null;index;comment:视频年份Id"`
	SpecsId               uint `gorm:"type:int;not null;index;comment:视频规格Id"`
	PayId                 uint `gorm:"type:int;not null;index;comment:视频付费类型Id"`
	EpisodeCount          int  `gorm:"type:int;not null;index;default:0;comment:剧集总数"`
	SerializeEpisodeCount int  `gorm:"type:int;not null;index;default:0;comment:连载剧集数量"`
	PlayCount             int  `gorm:"type:int;not null;index;default:0;comment:播放数量"`
	LikeCount             int  `gorm:"type:int;not null;index;default:0;comment:喜欢数量"`
	CommentCount          int  `gorm:"type:int;not null;index;default:0;comment:评论数量"`
	CollectCount          int  `gorm:"type:int;not null;index;default:0;comment:收藏数量"`
	Duration              int  `gorm:"type:int;not null;index;default:0;comment:视频时长"`
}

// 视频剧集
type VideoEpisode struct {
	gorm.Model
	VideoId      uint   `gorm:"type:int;not null;index;comment:视频ID"`
	Title        string `gorm:"type:varchar(50);not null;index;comment:剧集标题"`
	Desc         string `gorm:"type:varchar(255);not null;index;comment:剧集描述"`
	CoverUrl     string `gorm:"type:varchar(255);not null;index;comment:剧集封面"`
	PlayCount    int    `gorm:"type:int;not null;index;default:0;comment:播放数量"`
	LikeCount    int    `gorm:"type:int;not null;index;default:0;comment:喜欢数量"`
	CommentCount int    `gorm:"type:int;not null;index;default:0;comment:评论数量"`
	CollectCount int    `gorm:"type:int;not null;index;default:0;comment:收藏数量"`
}

// 视频分类
type VideoCategory struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:分类名称"`
}

// 频道表
type Channel struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:频道名称"`
}

// 视频地区
type VideoArea struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:地区名称"`
}

type VideoTypes struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:类型名称"`
}

// 视频年份
type VideoYear struct {
	gorm.Model
	Year string `gorm:"type:varchar(20);not null;index;comment:年份"`
}

// 视频规格
type VideoSpecs struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:规格名称"`
}

// 付费类型
type VideoPayTypes struct {
	gorm.Model
	TypesName string  `gorm:"type:varchar(50);not null;index;comment:付费类型"`
	Price     float64 `gorm:"type:float;index;comment:价格"`
}

// 视频封面
type VideoCover struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:封面名称"`
}

// 视频描述
type VideoDesc struct {
	gorm.Model
	Name string `gorm:"type:varchar(50);not null;index;comment:视频描述"`
}

type VideoSearchParams struct {
	gorm.Model
	ID          uint   `gorm:"column:id"`
	Title       string `gorm:"column:title"`
	PlayCount   int64  `gorm:"column:play_count"`
	ChannelName string `gorm:"column:channel_name"`
	AreaName    string `gorm:"column:area_name"`
	PayTypeName string `gorm:"column:pay_type_name"`
}
